<?php
/**
 * Yotaku shop - yshop
 * Copyright (c) 2016 http://www.yotaku.cn All rights reserved.
 * Author: Creatint <creatint@163.com> <http://creatint.yotaku.cn>
 */
namespace Home\Model;
use Think\Model;

class ArticleModel extends Model{
    protected $error = '';
    public function getError(){
        return $this->error;
    }
    public function getDetail($id){
        if(is_numeric($id)){
            $map['id']  =   $id;
        }
        $map['status'] = 1;
        if($result = $this->where($map)->find()){
            return $result;
        }else{
            $this->error    =   'ID不存在';
            return false;
        }
    }
}